﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.GameRules" Title="" StylesheetTheme="SkinFile" Codebehind="GameRules.aspx.cs" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, GameRules_PageNameLabel %>" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <a name="top"></a>
    <asp:HiddenField ID="EditVisibleHiddenField" runat="server" />
    <asp:UpdatePanel ID="RulesUpdatePanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="PageTitleLabel" runat="server" Text="<%$ Resources:Resource, GameRules_PageNameLabel %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:ListView ID="SummaryListView" runat="server" DataSourceID="GamerulesDataSourse"> 
            <LayoutTemplate>
                <label id="itemPlaceholder" runat="server"></label>
            </LayoutTemplate>
            <ItemTemplate>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ChapterNum", "#{0}") %>'
                  Text='<%# Eval("ChapterNum") + ". " + Eval("ChapterName") %>' SkinID="GreenTitleHyperLink"></asp:HyperLink>
            </ItemTemplate>
            <ItemSeparatorTemplate><br /></ItemSeparatorTemplate>
        </asp:ListView>
    </div>
    </div>
    <asp:ListView ID="ListView1" runat="server" DataSourceID="GamerulesDataSourse">
        <LayoutTemplate>
            <label id="itemPlaceholder" runat="server"></label>
        </LayoutTemplate>
        <EmptyDataTemplate>
            <asp:Label ID="NoDataLabel" runat="server" Text="<%$ Resources:Resource, GameRulest_NoDataLabel %>"  SkinID="GridLabel"></asp:Label>
        </EmptyDataTemplate>
        <ItemTemplate>
            <div class="basic_element">
            <div class="red_title">
                <a name='<%# Eval("ChapterNum") %>'></a>
                <asp:Label ID="ChapterNum" runat="server" Text='<%# Eval("ChapterNum") %>' CssClass="white_title"></asp:Label>
                <asp:Label ID="ChapterName" runat="server" Text='<%# Eval("ChapterName") %>' CssClass="white_title"></asp:Label>
               
            </div>
            <div class="padding5">
                <asp:Label ID="ChapterTextLabel" runat="server" Text='<%# EncodeText(Eval("ChapterText")) %>'
                    Width="100%" SkinID="GameRulesText"></asp:Label>
                <br /><br />
            
                <asp:LinkButton ID="EditLinkButton" runat="server" SkinID="GreenTitleLink" Visible='<%# EditVisible() %>' 
                Text="<%$ Resources:Resource, Global_Edit %>" CommandName="Edit"></asp:LinkButton>
                <br />
                <asp:HyperLink ID="BackToTheTopLink" runat="server" NavigateUrl="#top" SkinID="GreenTitleHyperLink"
                Text="<%$ Resources:Resource, GameRules_BackToTheTop %>"></asp:HyperLink>
            </div>
            </div>

            
        </ItemTemplate>
        <EditItemTemplate>
            <div class="basic_element">
                <a name='<%# Eval("ChapterNum") %>'></a>
                <asp:HiddenField ID="RulesIdHiddenField" runat="server" Value='<%# Bind("RulesId") %>' />
                <asp:Label ID="ChapterNum" runat="server" Text='<%# Eval("ChapterNum") %>' SkinID="GameRulesHeader"></asp:Label>
                <asp:TextBox ID="ChapterNameTextBox" runat="server" Text='<%# Bind("ChapterName") %>' TextMode="SingleLine"
                 Width="400" MaxLength="256"></asp:TextBox>             
                
                    <asp:UpdateProgress ID="RulesEditProgress" runat="server" AssociatedUpdatePanelID="RulesUpdatePanel">
                    <ProgressTemplate>
                    <div class="ajaxloader">
                        <asp:Image ID="ProgressImage" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
                    </div>
                    </ProgressTemplate>
                    </asp:UpdateProgress>
                
                <CustomControls:TextArea ID="ChapterTextTextBox" runat="server" Text='<%# Bind("ChapterText") %>' TextMode="MultiLine"
                 Width="100%" Rows="15" ></CustomControls:TextArea>
                <br />
                <asp:LinkButton ID="UpdateLinkButton" runat="server" SkinID="GreenTitleLink"
                 Text="<%$ Resources:Resource, Global_Update %>" CommandName="Update" ></asp:LinkButton>
                 &nbsp;&nbsp;
                <asp:LinkButton ID="CancelLinkButton" runat="server" SkinID="GreenTitleLink"
                 Text="<%$ Resources:Resource, Global_Cancel %>" CommandName="Cancel"></asp:LinkButton>
             </div>
        </EditItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="GamerulesDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetGameRules" SelectCommandType="StoredProcedure"
        UpdateCommand="Nivdal_UpdateGameRules" UpdateCommandType="StoredProcedure">
        <UpdateParameters>
            <asp:Parameter Name="RulesId" Type="Decimal" />
            <asp:Parameter Name="ChapterName" Type="String" />
            <asp:Parameter Name="ChapterText" Type="String" />            
        </UpdateParameters>    
    </asp:SqlDataSource>
    </ContentTemplate>
    </asp:UpdatePanel>
    <!-- Google Code for &#1492;&#1512;&#1513;&#1502;&#1492; Conversion Page -->
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 982634092;
    var google_conversion_language = "en";
    var google_conversion_format = "3";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "IuHlCPSowwIQ7JzH1AM";
    var google_conversion_value = 0;
    /* ]]> */
    </script>
    <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/982634092/?label=IuHlCPSowwIQ7JzH1AM&amp;guid=ON&amp;script=0"/>
    </div>
    </noscript>

</asp:Content>
